package com.ibeeking.found.msg.rest.service;

import com.ibeeking.found.msg.service.common.bo.WxMpSourceBO;
import com.ibeeking.found.msg.service.common.param.WxMpSourceParam;
import com.ibeeking.found.msg.service.common.query.WxMpImageTextQuery;
import com.ibeeking.found.msg.service.common.query.WxMpSourcePageQuery;
import com.ibeeking.found.msg.service.common.vo.WxMpSourcePageVO;
import com.ibeeking.found.msg.service.common.vo.WxMpSourceSimpleVO;
import com.ibeeking.found.msg.service.common.vo.WxMpSourceVO;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
import org.springframework.http.ResponseEntity;

/**
 * @ClassName IWxMpSourceService
 * @Description
 * @Author ibeeking
 * @Date 2021-02-03 20:08
 **/
public interface IWxMpSourceService {

    /**
     * 素材分页列表
     *
     * @param query
     * @return
     */
    Page<WxMpSourcePageVO> pageList(WxMpSourcePageQuery query);

    /**
     * 素材新增
     *
     * @param param
     * @return
     */
    String add(WxMpSourceParam param);

    /**
     * 素材修改
     *
     * @param param
     * @return
     */
    Boolean modify(WxMpSourceParam param);

    /**
     * 素材查看
     *
     * @param id
     * @return
     */
    WxMpSourceVO view(Long id);

    /**
     * 素材查看
     *
     * @param mediaId
     * @return
     */
    WxMpSourceVO queryByMediaId(String mediaId);

    /**
     * 素材简易信息dto
     *
     * @param id
     * @return
     */
    WxMpSourceSimpleVO sourceSimpleDtoView(Long id);

    /**
     * 素材删除
     *
     * @param id
     * @return
     */
    Boolean delRemoteAndLocalSource(Long id, Integer type);

    /**
     * 通过id查询mediaId
     *
     * @param sourceId
     * @return
     */
    String uploadMediaToWx(Long sourceId);

    /**
     * 通过id查询
     *
     * @param sourceId
     * @return
     */
    WxMpSourceBO querySourceById(Long sourceId);

    /**
     * 上传图文
     *
     * @param query
     * @return
     */
    String uploadImageTextMediaToWx(WxMpImageTextQuery query);

    /**
     * 同步微信公众号图片素材
     *
     * @param type:
     * @return
     */
    Integer syncPicSourceFromWx(String type);
    /**
     * 发布素材
     *
     * @param id
     * @return
     */
    Boolean publishMediaSource(Long id);
    /**
     * 草稿箱素材
     *
     * @param id
     * @return
     */
    WxMediaUploadResult getTempMedia(Long id, String type, String appId);
    /**
     * 草稿箱素材
     *
     * @param mediaId
     * @return downloadUrl
     */
    String getVedioMediaSourceUrl(String mediaId);
    /**
     * 已发布素材
     *
     * @param mediaId
     * @return ResponseEntity<byte[]>
     */
    ResponseEntity<byte[]> downloadPublishedVideoSource(String mediaId, String fileName);
    /**
     * 草稿箱素材
     *
     * @param mediaId
     * @return ResponseEntity<byte[]>
     */
    ResponseEntity<byte[]> downloadDraftVideoSource(String mediaId, String fileName);
}
